feat: export subplot_fit_interferometer_dirty_images (autolens's own) - #670
Merged
Conversation
`aplt.subplot_fit_dirty_images` resolves to the AUTOGALAXY implementation inside `autolens.plot`, so autolens's own version in `autolens/interferometer/plot/fit_interferometer_plots.py` was reachable under no exported name at all. The autolens version auto-derives the tracer's critical curves from the fit when `image_plane_lines is None` and overlays them on the dirty model image — lensing information the autogalaxy version cannot produce. Exported additively as `subplot_fit_interferometer_dirty_images`, matching the existing `subplot_fit_real_space` / `subplot_fit_interferometer_real_space` convention. `subplot_fit_dirty_images` is deliberately left bound to the autogalaxy version: the two signatures differ (`residuals_symmetric_cmap` vs `image_plane_lines`), so rebinding it would be a behaviour change rather than an additive export. Follow-up 4 from #667. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up 4 from #667 — a live API defect.
aplt.subplot_fit_dirty_imagesresolves to the autogalaxy implementation insideautolens.plot:autolens has its own version in
autolens/interferometer/plot/fit_interferometer_plots.py, and it was reachable under no exported name at all.That version is not merely a duplicate. When
image_plane_lines is Noneit auto-derives the tracer's critical curves from the fit and overlays them on the dirty model image — lensing information the autogalaxy version cannot produce. Lens users callingaplt.subplot_fit_dirty_imageswere silently getting the galaxy version and losing that overlay.API Changes
One symbol added:
subplot_fit_interferometer_dirty_images, bound to autolens's own function. Purely additive — nothing removed, renamed, or resignatured.subplot_fit_dirty_imagesis deliberately left bound to the autogalaxy version. The two signatures diverge (residuals_symmetric_cmapon the AG side,image_plane_lines/image_plane_line_colorson the AL side), so rebinding it would be a behaviour change, not an additive export.This matches the convention already in the file:
subplot_fit_real_space(autogalaxy) coexists withsubplot_fit_interferometer_real_space(autolens's own).subplot_fit_dirty_imageshad simply never been given itssubplot_fit_interferometer_*counterpart.See full details below.
Test Plan
autolens.…, old name still resolves toautogalaxy.…:subplot_fit_interferometer_dirty_images→autolens.interferometer.plot.fit_interferometer_plotssubplot_fit_dirty_images→autogalaxy.interferometer.plot.fit_interferometer_plots(unchanged)FitInterferometer, not just signature-checked: the new export renders and auto-derives 1 critical curve via_compute_critical_curve_lines; the old export still renders unchanged.git diff --stat= 2 files, 2 insertions, 0 deletionsFull API Changes (for automation & release notes)
Added
autolens.plot.subplot_fit_interferometer_dirty_images(fit, output_path=, output_format=, colormap=, use_log10=False, image_plane_lines=, image_plane_line_colors=, title_prefix=)— 2×3 subplot of dirty-image diagnostics for an interferometer fit, overlaying the tracer's critical curves on the dirty model image. Auto-derives the curves from the fit whenimage_plane_linesisNone. Re-export ofautolens.interferometer.plot.fit_interferometer_plots.subplot_fit_dirty_images.Removed / Renamed / Changed Signature / Changed Behaviour
None.
subplot_fit_dirty_imagescontinues to resolve to the autogalaxy implementation exactly as before.Migration
None required. Lens users wanting the critical-curve overlay switch call sites:
aplt.subplot_fit_dirty_images(fit=fit)— galaxy version, no overlayaplt.subplot_fit_interferometer_dirty_images(fit=fit)— overlay auto-derivedDeferred: the 11 existing workspace call sites
autolens_workspacecallsaplt.subplot_fit_dirty_imagesat 11 sites (scripts/interferometer/{fit,modeling,plot}.py, fourinterferometer/features/*/fit.py, andmulti/features/imaging_and_interferometer/modeling.py). All passfit=fitonly — none passresiduals_symmetric_cmap— so all 11 could be switched to the new name and would gain critical-curve overlays for free.Not done here: that is a visual change across 11 lens examples and deserves its own review, separate from making the function reachable. Filed against #667.
Generated by the PyAutoLabs agent workflow.